package com.honey.mybatis.generator.entity.field;

import java.util.Random;

import com.honey.compilation.java.Decoration;
import com.honey.core.types.FullyQualifiedJavaType;
import com.honey.core.types.JDKFullyQualifiedJavaType;
import com.honey.mybatis.generator.AbstractField;

public class SerialVersionUIDField extends AbstractField {

	private static final String FIELD_NAME="serialVersionUID";
	
	private static final FullyQualifiedJavaType TYPE= JDKFullyQualifiedJavaType.getLongInstance();
	
	private static final String[] JAVA_DOC= new String[]{
		
		"序列化对象版本标识。",
		
	};
	
	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractField#getFieldName()
	 */
	@Override
	protected String getFieldName() {
		return FIELD_NAME;
	}

	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractField#getDecoration()
	 */
	@Override
	protected Decoration getDecoration() {
		Decoration answer = super.getDecoration();
		answer.setFinal(true);
		answer.setStatic(true);
		return answer;
	}
	
	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractField#getInitialization()
	 */
	@Override
	protected String getInitialization() {
		return String.valueOf(new Random().nextLong());
	}

	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractField#getJavaDoc()
	 */
	@Override
	protected String[] getJavaDoc() {
		return JAVA_DOC;
	}

	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractField#getType()
	 */
	@Override
	protected FullyQualifiedJavaType getType() {
		return TYPE;
	}

	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractField#isBaseType()
	 */
	@Override
	protected boolean isBaseType() {
		return true;
	}
}
